﻿Public Class ucCalendar
    Inherits System.Web.UI.UserControl

	Public Property ValidationGroup As String
		Get
			Return Me.RegularExpressionValidator3.ValidationGroup
		End Get
		Set(ByVal value As String)
			Me.RegularExpressionValidator3.ValidationGroup = value
		End Set
	End Property

	Public Property value As String
		Get
			Return Me.txtResult.Text
		End Get
		Set(ByVal value As String)
			Me.txtResult.Text = value
		End Set
	End Property

	Public ReadOnly Property Year As Integer
		Get
			Return Me.GetValue.Value.Year
		End Get
	End Property

	Public ReadOnly Property Month As Integer
		Get
			Return Me.GetValue.Value.Month
		End Get
	End Property

	Public ReadOnly Property Day As Integer
		Get
			Return Me.GetValue.Value.Day
		End Get
	End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

	End Sub

	Public Function GetValue() As Nullable(Of DateTime)
		If Common.UtilityDateTime.ConvertDate(Me.txtResult.Text).HasValue Then
			Return Common.UtilityDateTime.ConvertDate(Me.txtResult.Text).Value
		Else
			Return Nothing
		End If
	End Function
End Class